{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Scalar Fields: eigenvalues"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## [Run this notebook on binder](https://mybinder.org/v2/gh/daavoo/pyntcloud/master)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this notebook we are going to learn about the avaliable scalar fields that require the eigenvalues of each point."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Imports"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyntcloud import PyntCloud"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Load ankylosaurus mesh"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We are going to load a 3D model of an ankylosaurus from the provided `examples/data.`\n",
    "\n",
    "You could load other point cloud in any of the supported [point cloud formats](http://pyntcloud.readthedocs.io/en/latest/io.html).\n",
    "\n",
    "You can learn more about reading and writing point clouds in the `examples/[io]` notebooks."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PyntCloud\n",
       "34820 points with 6 scalar fields\n",
       "69636 faces in mesh\n",
       "0 kdtrees\n",
       "0 voxelgrids\n",
       "Centroid: 0.029972486197948456, 1.1250594854354858, 2.887650489807129\n",
       "Other attributes:"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "anky = PyntCloud.from_file(\"data/ankylosaurus_mesh.ply\")\n",
    "anky"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "From the description, we can see that this is a 3D mesh with 69636 faces. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Visualization: Mesh"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "We can visualize the mesh with the `plot` method.\n",
    "\n",
    "Note that we are passing the argument `backend=\"threejs\"` because mesh visualziation is not currently supported with the default backend. \n",
    "\n",
    "Because of this, the visualization might don't work in some enviroments (i.e. binder). We are working to add support to mesh plotting with the default backend as soon as possible  in order to fix these issues."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "anky.plot(mesh=True, backend=\"threejs\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![mesh](data/images/structures-voxelgrid-1.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Convert Mesh to Point Cloud using random sampling."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can now convert the mesh into a point cloud by sampling 100.000 random points from the surface.\n",
    "\n",
    "You cand learn more about hoy to convert a triangular mesh into a point cloud in the `examples/[sampling]` notebooks."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "anky_cloud = anky.get_sample(\n",
    "    \"mesh_random\", n=100000, rgb=True, normals=True, as_PyntCloud=True\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that we pass the `normals=True` argument so now our point cloud has normal values for each point."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Visualization: Pandas built-in"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Because PyntCloud.points is a pandas.DataFrame, we can leverage the built-in [visualization options of pandas](https://pandas.pydata.org/pandas-docs/stable/visualization.html):"
   ]
  },
  {
   "cell_type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pC0tSI2JR+CT45yKFOA26KiO0Nx96UFl+RdCVwwWjGlZqXiIhfSboTeBdwI20+X5L2BX4AfDo1DdSPPezz1cRA35dm29Qk7QnsR9akkWffMuNC0vvJEvV7IuKVevkAP9MifkkOGVdEbGlY/QbwhYZ9j+m3750FxJQrrganA4sbC0o8X0MZKO5SzpWbv4an6fQwkfV+/YisPwNgPpDnyieP5el4eY67S1tu+sVa78f4INB0pEgZcUnav958JGkK8IfAz9t9vtLP7iay9uYb+n1W5PnKM51QY7x/BtyRzs9y4HRlo8N6gRnAfSOIpaW4JL0L+DpwUkQ82VDe9Gc6inFNbVg9CfhFWl73Z6QcAAABNklEQVQBzEvx7Q/M4/VX7KXGlWI7hKzj++6GsjLP11CWA2emUWBHAc+mP5rKOVdljEao8gs4hSyDvwI8AaxI5W8FbmnY7gPAf5P9pfE3DeUHk/2nXw/cAIwvKK7JwO3AuvQ+KZXPBb7ZsF0P8Btgj3773wGsJvvl+C3gDaMVF/AHqe7/Su/njIXzBXwU2A482PCaVcb5avZ9IWtOOyktd6d///p0Pg5u2Pdv0n4PAycU/H0fKq7b0v+D+vlZPtTPdJTi+jywNtX/I+DtDft+LJ3H9cDZoxlXWr8YuLTffqWdL7I/IDel73KNrO/r48DH0+cie5jhI6nuuQ37Fn6ufEe9mZkVxs1fZmZWGCcVMzMrjJOKmZkVxknFzMwK46RiZmaFcVIxM7PCOKmYmVlhnFTMzKww/x921NINNzQTVAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 3 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "anky_cloud.points[[\"nx\", \"ny\", \"nz\"]].plot(kind=\"hist\", subplots=True);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Visualization: Point Cloud"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can visualize the sampled point cloud as follows:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "anky_cloud.plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![anky_cloud](data/images/structures-voxelgrid-2.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can use the interactive widgets bellow the plot to dynamically adjust the background color and the point size."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Getting `k` nearest neighbors"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We need to find the `k` nearest neighbors of each point.\n",
    "\n",
    "\n",
    "You cand learn more about hoy to find neighbors in `examples/[neighbors]` notebooks."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Note**\n",
    "\n",
    "The number of neighbors has a high impact on the results of the different scalar fields that will be computed above, it should be selected according to the density of your point cloud."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "k_neighbors = anky_cloud.get_neighbors(k=25)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We need to get the eigen values associated to each point.\n",
    "\n",
    "You can learn more about this scalar field in `examples/[scalar_fields] Neighbors`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "eigenvalues = anky_cloud.add_scalar_field(\"eigen_values\", k_neighbors=k_neighbors)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Anisotropy"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\\huge A_\\lambda = \\frac{\\lambda_1 - \\lambda_3}{\\lambda_1}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "anisotropy = anky_cloud.add_scalar_field(\"anisotropy\", ev=eigenvalues)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZsAAAD8CAYAAAChHgmuAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFUhJREFUeJzt3X+wZ3V93/Hny12Jkqqgu1i7iy42G+OG0RE3SGsbDURYSMJqoik0LStD3I5FYxLbBtMfOBom2kmDYTQkWDYCTSRIUtlE7M6KGKcdQBYxIhDLFi2sUNm4CESiCHn3j+9n9TvL3b3n3r2f+7189/mY+c4953M+55z3Z+7Ca845n3u+qSokSerpaZMuQJI0/QwbSVJ3ho0kqTvDRpLUnWEjSerOsJEkdWfYSJK6M2wkSd0ZNpKk7pZPuoClYsWKFbVmzZpJlyFJTym33HLLX1fVytn6GTbNmjVr2LFjx6TLkKSnlCT/d0g/b6NJkrozbCRJ3XULmyRbkjyQ5Etjbc9Nsj3JXe3nka09SS5KsjPJF5McN7bPptb/riSbxtpfmeS2ts9FSXKgc0iSJqfnlc1HgA37tJ0HXFdVa4Hr2jrAqcDa9tkMXAyj4ADOB14FHA+cPxYeF7e+e/fbMMs5JEkT0i1squqzwJ59mjcCl7Xly4DXj7VfXiM3AkckeQFwCrC9qvZU1YPAdmBD2/bsqrqhRl/Ic/k+x5rpHJKkCVnsZzbPr6r7AdrPo1r7KuDesX67WtuB2nfN0H6gczxJks1JdiTZsXv37nkPSpJ0YEtlgkBmaKt5tM9JVV1SVeurav3KlbNOE5ckzdNih83X2y0w2s8HWvsu4OixfquB+2ZpXz1D+4HOIUmakMUOm63A3hllm4BrxtrParPSTgAearfA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MZqteu7ECh4gyUcZ1byiPTs7H3g6QFX9HqNnaacBO4FHgbMX9PxL+PctSZoSh/ptNEnSIjBsJEndGTaSpO4MG0lSd4aNJKk7w0aS1J1hI0nqzrCRJHX3/wE336DaTrgClAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "anky_cloud.points[anisotropy].plot(kind=\"hist\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "anky_cloud.plot(use_as_color=anisotropy, cmap=\"jet\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![anisotropy](data/images/scalar_fields-eigen_values-1.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Curvature"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\\huge C_\\lambda = \\frac{\\lambda_3}{\\sum_\\lambda}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "curvature = anky_cloud.add_scalar_field(\"curvature\", ev=eigenvalues)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZsAAAD8CAYAAAChHgmuAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFLBJREFUeJzt3X2wXdV93vHvYym8ucUII7uuhC1IVCfgiQeQgcZN0hgbhB1bpDUtnrRoKI06Dm6TpjM1xG3J2GEGz6QhZurgUEMtaBKMSWrUGqqR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W5uRHplzAJrPmJ8G3lhV30pyGvD5JCdX1fML3ckO5vN9TfJ3PZM3VtWOJCcCX0ryUFX92QL1raeRx53knwCrgJ+d7b4HoPmMG+b5fXtmM7NRHnvzV22SLAZeA+wacd8D0ZzH3C4Zfgugqu5lcH3473Tv8cKYz/c1yd/1XlXVjva+DfgKcMpCdq6jkcad5J3AR4D3VdVLs9n3ADWfcc//+x73TasD+cXgzG8bgxv8UzfUTt6jzSX89ZvlN7flk/nrEwS2cXBMEJjPmJdOjZHBTchvAMeOe0wLNe6htp/hlRMEHmdww3hJWz7gxz3PMS8BDm/LxwFb2ONm84H6GvHf8VMY/M/Syj3qB+V3vQDjnvf3PfZ/AAf6C3g38H/aF/CRVvsog9QHOAL4HIMJAHcDJw7t+5G232PAueMeS+8xA/8QeLj9S3wf8N5xj2WBx/02Bv93+F3gW8DDQ/v+s/bPYytw0bjH0nvMwE8BD7Xv+iHg4nGPZYHH/UXgm8AD7bXhYP+u5zPuhfi+fYKAJKk779lIkrozbCRJ3Rk2kqTuDBtJUneGjSSpO8NGktSdYSNJ6s6wkSR19/8B6KTtUBETH3cAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "anky_cloud.points[curvature].plot(kind=\"hist\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "anky_cloud.plot(use_as_color=curvature, cmap=\"jet\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![curvature](data/images/scalar_fields-eigen_values-2.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Eigenentropy"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\\huge E_\\lambda = - \\sum_{j=1}^{3} \\lambda_j \\ln(\\lambda_j)$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\users\\daavoo\\desktop\\pyntcloud\\pyntcloud\\scalar_fields\\eigenvalues.py:50: RuntimeWarning: invalid value encountered in log\n",
      "  result += ev[:, i] * np.log(ev[:, i])\n"
     ]
    }
   ],
   "source": [
    "eigenentropy = anky_cloud.add_scalar_field(\"eigenentropy\", ev=eigenvalues)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAD8CAYAAAC/1zkdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGmNJREFUeJzt3XGUVvV95/H3RxDEJgaVMUsAOySZ0wQ9CZpROSe7Zy1mZTDbgFttsD2R49LSGjhJTrtbIe2pqQk9eJpISlZNSZwINgmiNpGNY1litGl2FRgrAZFYpsiGEVbGgqI1gUK++8f9jXkcn5nnznDvPM84n9c59zz3fu/vd+/3Dof5zr2/+9yriMDMzKwIp9U7ATMze+twUTEzs8K4qJiZWWFcVMzMrDAuKmZmVhgXFTMzK4yLipmZFcZFxczMCuOiYmZmhRlb7wSG26RJk6K5ubneaZiZjShPPvnkixHRVKvdqCsqzc3NdHZ21jsNM7MRRdL/zdPOl7/MzKwwLipmZlYYFxUzMytM6UVF0hhJT0n6XlqeLmmLpD2S7pU0LsXHp+WutL65YhvLU/xZSXMq4m0p1iVpWdnHYmZmAxuOM5VPA7srlm8FVkVEC3AEWJTii4AjEfFeYFVqh6QZwALgAqANuCMVqjHA7cBcYAZwXWprZmZ1UmpRkTQV+Cjw9bQsYDZwf2qyFpif5uelZdL6K1L7ecD6iD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jXeYBa9P8/cAVkpTi6yPiWEQ8B3Sl7VXdZuozO22DtM35jZQjQEQ8FRH7cuRVr/w6IgG2kn0PqZHyOwrZX7PABKp88bae+Sl7Nt5fAn9cI6+65TgEw53fjcAtEfELgIg41GD5ASDp7WS/c+p+pjKaikq1R7pM6a9NRJwAXgbOHaBvf/FzgZfSNvrbV71zHIq65KfsstcngL9rtPwkfQP4f8D7gK80WH5LgY0RcbBGXvXMEWBFuoS4StL4BsvvPcDHJXVKelhSS4Pl1+tq4JHeP3TqaTQVlTyPdOmvTVHxWoYzx6GoV353AD+MiH9otPwi4gbgXcBu4OONkp+kdwHXUrvQ9TXcP8PlZAX5EuAc4KYGy2888PPIvuH+NaC9wfLrdR3ZJeK6G01FJc8jXV5vI2ks8A7g8AB9+4u/CExM2+hvX/XOcSiGPT9JNwNNwB82Yn4AEXESuBf4zQbK7yLgvUCXpH3AmZK6auQ33DkSEQfTFc5jwDfILvU0TH5p3QNp/jvABxosPySdS/Zzq99TMivVe1BnuCayL3ruJRsA6x3suqBPmyW8cQBtQ5q/gDcOoO0lGzzrd5vAfbxxoP6TjZZjxTb3kW+gfrh/hr8L/B9gQqP9G5P99fje1FfAF4EvNkp+Vfadd6B+uP+NJ1f8DL8MrGyw/FYC/zXNXw5sa6T8Ur8/ANae6u/Ioqa6JzCsB5vdTfRPZHdS/EmK3QJ8LM2fQVYMusgGht9d0fdPUr9ngbkDbTPF35220ZW2Ob4Bc/wU2V9BJ8j+8vl6g+V3IsW2p+nPGiU/srP8/w3sBJ4GvknF3WD1zq/KfnMVlTr8G/+g4mf4N8DbGiy/iWRnADuBx4EPNlJ+ad1jQFvef9+yJ3+j3szMCjOaxlTMzKxkLipmZlYYFxUzMyuMi4qZmRXGRcXMzArjomJmZoVxUTEzs8K4qJiZWWH+P5w25YxNvVDbAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "anky_cloud.points[eigenentropy].plot(kind=\"hist\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "anky_cloud.plot(use_as_color=eigenentropy, cmap=\"jet\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![eigenentropy](data/images/scalar_fields-eigen_values-3.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Sum of eigenvalues"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\\huge \\sum_\\lambda = \\sum_{j=1}^{3} \\lambda_j$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "eigensum = anky_cloud.add_scalar_field(\"eigen_sum\", ev=eigenvalues)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAD8CAYAAAC/1zkdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFq1JREFUeJzt3X20XXV95/H3x0RQWxWE6LACNuik1uhS0Ih0OWvGRwg4Cs5gJ6yZmrqw6WiY1lX/MGjXwKjMYGcqLas+4ZhlcKoRsS2pxmYixbrslIeoCAakuSIjMSwIBsSHFgrznT/O79bj5dx7T8I+99xD3q+19rp7f/dv7/09F7gf9sM5J1WFJEldeNy4G5AkPXYYKpKkzhgqkqTOGCqSpM4YKpKkzhgqkqTOGCqSpM4YKpKkzhgqkqTOLB13Awvt6KOPrhUrVoy7DUmaKF/72tfuqapl84075EJlxYoV7Ny5c9xtSNJESfJ/hxnn5S9J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<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "anky_cloud.points[eigensum].plot(kind=\"hist\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "anky_cloud.plot(use_as_color=eigensum, cmap=\"jet\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![eigensum](data/images/scalar_fields-eigen_values-4.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Linearity"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\\huge L_\\lambda = \\frac{\\lambda_1 - \\lambda_2}{\\lambda_1}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "linearity = anky_cloud.add_scalar_field(\"linearity\", ev=eigenvalues)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAD8CAYAAAC/1zkdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGL9JREFUeJzt3X/wXXV95/HnSxCVKgUkIE1Ig05wRcaiZJEd19YWxYC7BDtqYbYSXdaohW0dnZ1G6xRGZYe2KouzLhprluAqPxSVrMSlkfXHugNCUOSnLAFT+JoMREChxULB9/5xP1+8Jvf7zU1y7vfmmzwfM3e+57zP59zzOWeAN58f93xSVUiS1IVnjLsCkqTdh0lFktQZk4okqTMmFUlSZ0wqkqTOmFQkSZ0xqUiSOmNSkSR1xqQiSerM3uOuwEw76KCDasGCBeOu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M+B589I7cZnmOfS7wzg6yOt0a5jm88mycuBw6rqazNZsV3AMP/cHAEckeT/JrkuyeIZq914DfNszgH+OMkEvVmu/3FmqrbjZv2U4hEY5tUvQ70eZjcz9D0n+WNgEfB7I63RrmPaZ5PkGcD5wNtmqkK7kGH+udmbXhfYa+i1bv9PkqOq6mcjrtu4DfNsTgMuqqqPJflXwOfas/nl6Ku3Y2ypbG2YV788XSbJ3vSapQ/NSO3GZ6hX4iR5LfAXwMlV9fgM1W3ctvVsngccBXwryQbgOGD1HjJYP+y/T1dW1T9X1Y+BO+klmd3dMM/mDOBygKq6Fng2vfeC7bJMKlsb5tUvq4GlbftNwP+uNpK2G9vmc2ldPJ+ml1D2lH5x2MazqaqfV9VBVbWgqhbQG286uarWjae6M2qYf5++Sm+SB0kOotcdds+M1nI8hnk29wLHAyR5Cb2ksnlGa7mdTCpbaGMkk69+uQO4vKpuS/KhJCe3Yp8Fnp9kPfBeYLdfcXLI5/I3wHOBLya5Kcke8R62IZ/NHmnIZ3M18GCS24FvAv+pqh4cT41nzpDP5n3AO5L8ELgEeNuu/j+w/qJektQZWyqSpM6YVCRJnTGpSJI6Y1KRJHXGpCJJ6oxJRZLUGZOKJKkzJhVJUmf+PyfPxKkFiUfOAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "anky_cloud.points[linearity].plot(kind=\"hist\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "anky_cloud.plot(use_as_color=linearity, cmap=\"jet\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![linearity](data/images/scalar_fields-eigen_values-5.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Omnivariance"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\\large O_\\lambda = \\sqrt[3]{\\prod_{j=1}^{3}\\lambda_j}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\users\\daavoo\\desktop\\pyntcloud\\pyntcloud\\scalar_fields\\eigenvalues.py:77: RuntimeWarning: invalid value encountered in power\n",
      "  self.to_be_added[name] = np.nan_to_num((ev[:, 0] * ev[:, 1] * ev[:, 2]) ** (1 / 3))\n"
     ]
    }
   ],
   "source": [
    "omnivariance = anky_cloud.add_scalar_field(\"omnivariance\", ev=eigenvalues)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAD8CAYAAAC/1zkdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGrBJREFUeJzt3X2QFdd55/HvzyD0YkcGpJEXM5BBm8nGSGVjaYxIObvrIAcGaWPwRtqAkzAlU5lERrVWrTcBFNfqzVRJSRyyqsiy8QoLlBeE5TgiFgqLZNlZb1mCwcJICBPGiBUjKIE86M2yUZCf/aPPyK3h3rnN0HfuXPT7VN263U+f030Ow9xnuk/fPooIzMzMyvCORjfAzMxOH04qZmZWGicVMzMrjZOKmZmVxknFzMxK46RiZmalcVIxM7PSOKmYmVlpnFTMzKw0YxvdgJF2/vnnR1tbW6ObYWbWVLZv3/5CRLTUKve2SyptbW309PQ0uhlmZk1F0v8rUs6Xv8zMrDROKmZmVhonFTMzK42TipmZlcZJxczMSuOkYmZmpXFSMTOz0jipmJlZaZxUzMysNG+7b9Q3o7blDzbs2Ptvu7Jhxzaz5uMzFTMzK42TipmZ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X/6V976Oz6j1uevv1FvZmalOR3HVMzMrEGcVMzMrDROKmZmVhonFTMzK42TipmZlcZJxczMSuOkYmZmpXFSMTOz0vx/9Hm06Kz+YbkAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "anky_cloud.points[omnivariance].plot(kind=\"hist\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "anky_cloud.plot(use_as_color=omnivariance, cmap=\"jet\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![omnivariance](data/images/scalar_fields-eigen_values-6.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Planarity"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\\huge P_\\lambda = \\frac{\\lambda_2 - \\lambda_3}{\\lambda_1}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "planarity = anky_cloud.add_scalar_field(\"planarity\", ev=eigenvalues)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAD8CAYAAAC/1zkdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAElRJREFUeJzt3XuwXXV5xvHvI2gFRYEGKAU02olWylTBCHTsRcVCgBF0KlamlshQ00Fsa3U6RnqBgTpDL2pLa9U4Zri0XvBKWkJpZFTajggHsdyUIcUUYhgIBgFFQfDtH3sd3IaTn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gNu2sLrxwGXM/is35HAV1st2z2V+ePxW9ZU1SPA9C1rHldVX6yqh7rJqxl8rmc+mXUbdM4F/hr44Vw2N0f6bIO3AB+oqvsAquqeOe5xlPqsfwHP6p4/mxk+2zbpquoqYNNWhpwIXFQDVwN7Jtm/xbINlfljW29ZcxqD/6nMJ7NugySHAgdV1b/NZWNzqM/vwQuAFyT57yRXJ1kyZ92NXp/1Pxt4U5L1DK4c/YO5aW2HMrJbXE38JcV6XK9b1gAkeROwGPiNkXY097a6DZI8BXg/8Oa5amgM+vwe7MrgENgrGOyt/meSQ6rquyPubS70Wf+TgQuq6r1JfgW4uFv/H4++vR1G778X28o9lfmj1y1rkrwa+FPghKp6eI56myuzbYM9gEOALyVZx+BY8qp5drK+z+/BeuDSqvpRVX0LuJVByMwHfdb/NOASgKr6CvB0BvfE2pn0+nuxPQyV+WPWW9Z0h34+zCBQ5tNx9Glb3QZVdX9VLaiqhVW1kMF5pROqamo87Y5En1sXfZ7BRRskWcDgcNjtc9rl6PRZ/zuAowCSvIhBqGyc0y7HbxVwSncV2JHA/VV1V4sZe/hrnqgt3LImyTnAVFWtAv4GeCbwqSQAd1TVCWNrurGe22Be67kNrgCOTnIL8BjwJ1X1nfF13U7P9X8n8JEkf8zgkM+bq7skar5I8nEGhzcXdOeOzgKeClBVH2JwLuk4YC3wEHBqs2XPs20pSRojD39JkpoxVCRJzRgqkqRmDBVJUjOGiiSpGUNFktSMoSJJasZQkSQ18/+OS2PDFY7KuQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "anky_cloud.points[planarity].plot(kind=\"hist\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "anky_cloud.plot(use_as_color=planarity, cmap=\"jet\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![planarity](data/images/scalar_fields-eigen_values-7.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Sphericity"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\\huge S_\\lambda = \\frac{\\lambda_3}{\\lambda_1}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "sphericity = anky_cloud.add_scalar_field(\"sphericity\", ev=eigenvalues)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZsAAAD8CAYAAAChHgmuAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFQNJREFUeJzt3X/wZXV93/Hny90gYFVAFmt3SRaSjQYdHXFFWts0EcVFE5a0kELTsnGI2xpsTM1MxSQtjoaJtqkooyGSQgSaBJGksokQZkWMk478WH4EBGLZAIUNVDYuApEIrr77x/2s3lm+u9/z/fH53uX6fMzc+Z7zOZ9zzvszl+++uOd8vuemqpAkqafnTLoASdL0M2wkSd0ZNpKk7gwbSVJ3ho0kqTvDRpLUnWEjSerOsJEkdWfYSJK6Wz7pAvYVhx56aK1evXrSZUjSs8rNN9/8t1W1YrZ+hk2zevVqtmzZMukyJOlZJcn/HdLPy2iSpO4MG0lSd93CJslFSR5J8uWxtkOSbE5yT/t5cGtPkvOSbE1ye5Kjx/bZ0Prfk2TDWPtrktzR9jkvSfZ2DknS5PT8ZPNJYN1ubWcB11bVGuDatg5wArCmvTYC58MoOICzgdcBxwBnj4XH+a3vrv3WzXIOSdKEdAubqvoisGO35vXAxW35YuCksfZLauR64KAkLwHeDGyuqh1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3AP+H0UyNX2tt72f0ywCwP/BpYCtwI3DkpGte4Hhey+j/YL4BfA24c9I1L8KYPgd8FbitvTZNuuYFjuejwJ1tLNcBL590zQsd0259v8A+PBtt4Hv0m+09+sv2Hr1s0jUvwpgCfJjRd4TdAZw62zF9goAkqTsvo0mSujNsJEndGTaSpO4MG0lSd4aNJKk7w0aS1J1hI0nqzrCRJHX3/wGZu0Ef8bpybgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "anky_cloud.points[sphericity].plot(kind=\"hist\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "anky_cloud.plot(use_as_color=sphericity, cmap=\"jet\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![sphericity](data/images/scalar_fields-eigen_values-8.png)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
